package adv327;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class SexTest {
    public static void main(String[] args) {
        Sex[] values = Sex.values();
        for(Sex s:values){
            System.out.println(s);
        }
        System.out.println(">>>>>>>>>>>>>>>");
        Sex nan = Sex.男;
        System.out.println(nan.name());
        System.out.println(nan.ordinal());
        System.out.println(">>>>>>>>>>>>>>>>>>");
        Student st=new Student();
        Scanner in=new Scanner(System.in);
        System.out.print("input name:");
        st.setName(in.next());
        System.out.print("input age:");
        st.setAge(in.nextInt());
        System.out.print("输入性别：");
        st.setSex( Sex.valueOf(in.next()));
        System.out.println(st);
       // Sex.valueOf() 字符串转换成enum
    }
}
